<template>
  <div>
    <!-- 子组件,传过来的数字是{{ num }} -->
    <br>
    子组件,model传过来的数字是{{ value }}

    <div>
      <!-- <button @click="$emit('add')">点击加1</button>
      <button @click="$emit('addn',6)">点击加n</button> -->
      <button @click="$emit('input',1)">点击加1</button>
      <button @click="$emit('input',3)">点击加3</button>
      <input ref="ipt">
    </div>
  </div>
</template>

<script>
export default {
  props: {
    // num: {
    //   type: Number,
    //   required: true
    // },
    value: {
      type: Number,
      required: true
    }
  },
  methods: {
    focus() {
      this.$refs.ipt.focus()
    }
  }
}
</script>

<style>

</style>
